import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:sjx/common_ui/navigation/navigation_bar_widget.dart';
import 'package:sjx/pages/home/home_page.dart';
import 'package:sjx/pages/mine/mine_page.dart';
import 'package:sjx/pages/share/share_page.dart';

class TabPage extends StatefulWidget {
  const TabPage({super.key});

  @override
  State<StatefulWidget> createState() {
    return _TabPageState();
  }
}

class _TabPageState extends State<TabPage> {
  //tab界面集合
  final List<Widget> tabItems = [];
  final List<String> tabLabels = ["任务", "我的"];
  final List<String> tabIcons = [
    "assets/images/renwu_n_btn.png",
    // "assets/images/tuiguang_n_btn.png",
    "assets/images/wo_n_btn.png"
  ];
  final List<String> tabActiveIcons = [
    "assets/images/renwu_s_btn.png",
    // "assets/images/tuiguang_s_btn.png",
    "assets/images/wo_s_btn.png"
  ];
  
  @override
  void initState() {
    super.initState();
    initTabPage();
  }
  
  void initTabPage() {
    tabItems.add(const HomePage());
    // tabItems.add(const SharePage());
    tabItems.add(const MinePage());
  }
  
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: null,
      body: NavigationBarWidget(
          tabItems: tabItems,
          tabLabels: tabLabels,
          tabIcons: tabIcons,
          tabActiveIcons: tabActiveIcons,
      ),
    );
  }

}